package org.example.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.example.entity.Note;
import org.example.service.NoteService;
import org.example.mapper.NoteMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
* @author 谢娅
* @description 针对表【note】的数据库操作Service实现
* @createDate 2023-12-21 23:25:23
*/
@Service
public class NoteServiceImpl extends ServiceImpl<NoteMapper, Note>
    implements NoteService{

    @Resource
    private NoteMapper noteMapper;

    @Override
    public List<Note> getDimQuery(Map<String, Object> dataMap) {
        return noteMapper.getDimQuery(dataMap);
    }

    @Override
    public Note getCurrentNote(Long userId) {
        return noteMapper.selectCurrentNote(userId);
    }

    @Override
    public int updateByMap(Map<String, Object> dataMap) {
        return noteMapper.updateByMap(dataMap);
    }

    @Override
    public List<Note> search(String keyword, String startTime, String endTime, String categoryId, Long userId) {
        return noteMapper.search(keyword, startTime, endTime, categoryId,userId);
    }

    @Override
    public List<Note> listByUserId(Long userId) {
        return noteMapper.listByUserId(userId);
    }

    @Override
    public List<Note> listByParentFolderId(Long userId,Long parentFolderId) {
        return noteMapper.listByParentFolderId(userId,parentFolderId);
    }
}




